import numpy as np
from numpy import *

a = np.matrix([ [1, 2],[3, 4] ] )
print(a)
'''
[[1 2]
 [3 4]]
'''

print(a.T)           #方法一，ndarray也行
'''
[[1 3]
 [2 4]]
'''

b = np.transpose(a)     #方法二
print(b)
'''
[[1 3]
 [2 4]]
'''

c = a.I   #求逆
print(c)
'''
[[-2.   1. ]
 [ 1.5 -0.5]]
'''